<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>后台管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="icon" href="javascript:;">
  <link rel="stylesheet" href="../../resource/layui/css/layui.css"  media="all">
  <link rel="stylesheet" href="../../resource/myResource/css/no_read_item.css">
</head>
<style>
</style>
<body>
    
    <form class="layui-form" action="">
        <input type="hidden" id="id">
        <div class="layui-form-item" style="margin-top:25px">
            <div class="layui-inline" >
                <label class="layui-form-label" style="width:60px">申报人</label>
                <div class="layui-input-inline mydiv">
                    <label id = "applicantName" class="layui-form-label myvaluelable"></label>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label"style="width:60px">维修地址</label>
                <div class="layui-input-inline mydiv">
                    <label id="repairAddr" class="layui-form-label myvaluelable"></label>
                </div>
            </div>
            
        </div>

        <div class="layui-form-item" style="margin-top:25px">
            <div class="layui-inline">
                <label class="layui-form-label" style="width:60px">申报时间</label>
                <div class="layui-input-inline mydiv">
                    <label id="addTime" class="layui-form-label myvaluelable"></label>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label" style="width:60px">操作管理员</label>
                <div class="layui-input-inline mydiv">
                    <label id="mName" class="layui-form-label myvaluelable"></label>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label" style="width:60px">信息:</label>
                <div class="layui-input-block" style="margin-left:10%;margin-right: 10% ;text-align:left;">
                    <textarea id="msg" placeholder="无报修说明" class="layui-textarea" readonly style="resize: none;"></textarea>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label" style="width:60px">图片:</label>
                <div class="layui-input-block" id="image"style="margin-left:10%;margin-right: 10% ;text-align:left;">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width:60px">维修师傅</label>
            <div class="layui-input-block" style="margin-left:10%;margin-right: 10% ; margin-bottom:100px;text-align:left;">
                <input id="wName" type="text" name="title" lay-verify="title" autocomplete="off" placeholder="无维修师傅" class="layui-input" disabled>
            </div>
        </div>
        <div style="margin-top:50px;margin-bottom: 25px">
            <!-- <button type="button" class="layui-btn layui-btn-normal "style="margin-left:80%" onclick="submit()">提交</button> -->
            <button type="button" class="layui-btn layui-btn-normal "style="margin-left:80%; margin-top:60px" onclick="submitBtn()">确认维修结束</button>               
        </div>

    </form>
    <script src="../../resource/jquery/dist/jquery.js"></script>
    <script src="../../resource/layui/layui.js" charset="utf-8"></script>
    <script src="../../resource/myResource/js/base.js"></script>
    <script src="../..//resource/myResource/js/repaorjs/repair_history_item.js"></script>
    <script type="text/javascript">
        layui.use(['form', 'layedit', 'laydate'], function(){});
        //获得id渲染页面
        // alert(GetQueryString("id"));

        // 调用方法： 
        // alert(GetQueryString("id"));
        $(function(){
            var id = GetQueryString("id");
            var type =  GetQueryString("type");
            // alert(type);
            /*填充信息*/
            $.ajax({
                url:head+"/other/repairROHOthereItem?itemId="+id,
                dataType:"json",
                type:"GET",
                success:function(redata){
                    // debugger;
                    var data = redata.data;
                    // $.each(redata.data.workerList,function(i,data){
                    //     var msg = data.name+"：  "+data.work
                    //     // alert(msg);
                    //     // debugger;
                    //     // $("#worker").append("1231321");
                    //     $("#worker").append('<option value="'+data.id+'">'+msg+'</option>');
                    
                    // });
                    if(redata.code != 0)
                      layer.msg(redata.msg);
                    layui.use('table',function(){
                        var util = layui.util;
                        // debugger;
                        $("#id").text(data.id);
                        $("#applicantName").text(data.applicantName);
                        $("#repairAddr").text(data.repairAddr); 
                        $("#msg").text(data.questionMsg);
                        $.each(data.pic,function(i,data){//添加图片
                            $("#image").append('<img style="width: 30%; height: auto; margin-left:10px" src="'+data+'" onclick="big(this)">');
                        });
                        $("#addTime").text(util.toDateString(data.addtime*1,"yyyy-MM-dd HH:mm"));
                        layui.use(['form', 'layedit', 'laydate'], function(){});
                        $("#wName").val(data.wName);
                        $("#mName").text(data.mName);
                    });
                }

            });
        });
            
    </script>
  <script type="text/javascript">
    function closeSelf(){
         window.parent.location.reload();
         var index = parent.layer.getFrameIndex(window.name);
         parent.layer.close(index);
         // parent.reload();
     }
     function submitBtn(){
         var id = GetQueryString("id");
         var type =  GetQueryString("type");
         $.ajax({
             url:head+"/repair/repairOtherEnd?itemId="+id,
             dataType:"json",
             type:"GET",
             success:function(redata){
                 closeSelf();
             }
         })
     }
  </script>
</body> 
</html>